import request from '@/utils/request'

// 查询门类树列表
export function listGROUPTree(query) {
  return request({
    url: '/archive/category/getcatemodeltree',
    method: 'get',
    params: query
  })
}

// 获取审批数据
export function getExamineList(data) {
  return request({
    url: '/archive/mjidentify/approve/list?pageNum='+ data.pageNum + '&pageSize=' + data.pageSize,
    method: 'post',
    data: data
  })
}

// 发起审批
export function initiateApproval(data) {
  return request({
    url: '/archive/mjidentify/initiate/approval',
    method: 'put',
    data: data
  })
}

// 取消审批
export function cancel(data) {
  return request({
    url: '/archive/mjidentify/cancel/approval',
    method: 'put',
    data: data
  })
}

// 终止流程
export function endWorkFlowInstance(data) {
  return request({
    url: '/activiti/activitiApiController/endWorkFlowInstance/'+ data.reason +'/' + data.instanceId,
    method: 'post'
  })
}

// 单个同意、不同意
export function formDataSave(data) {
  return request({
    url: '/activiti/task/formDataSave/'+ data.id,
    method: 'post',
    data: data
  })
}

// 发起审批页面列表
export function approvalList(data) {
  return request({
    url: '/archive/mjidentify/initiate/approval',
    method: 'post',
    data: data
  })
}

// 发起审批页面列表
export function searchApprovalBpmnBase64(instanceId) {
  return request({
    url: '/activiti/activitiHistory/searchApprovalBpmnBase64?instanceId='+instanceId,
    method: 'post'
  })
}

// 发起审批页面列表
export function getTable(id) {
  return request({
    url: '/archive/mjidentify/initiate/getInfoByInstanceId/' + id,
    method: 'post'
  })
}

// 获取审批过程
export function getProcessDateByInstanceId(id) {
  return request({
    url: '/activiti/activitiApiController/getProcessDateByInstanceId/' + id,
    method: 'get'
  })
}
